package com.kyivmohyla.kma2.client.view.refbook;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.kyivmohyla.kma2.client.presenter.refbook.ServiceReferenceBookPresenter;
import com.smartgwt.client.widgets.tree.TreeGrid;

public class ServiceReferenceBookView extends Composite implements ServiceReferenceBookPresenter.Display {
    @UiField
    protected TreeGrid referenceBook;
    @UiField
    protected Button add;
    @UiField
    protected Button cancel;

    @Inject
    public ServiceReferenceBookView() {
        initWidget(ourUiBinder.createAndBindUi(this));
    }

    @Override
    public TreeGrid getTreeGrid() {
        return referenceBook;
    }

    @Override
    public HasClickHandlers getAddButton() {
        return add;
    }

    @Override
    public HasClickHandlers getCancelButton() {
        return cancel;
    }

    @Override
    public Widget asWidget() {
        return this;
    }

    interface ServiceReferenceBookViewUiBinder extends UiBinder<Widget, ServiceReferenceBookView> {
    }

    private static ServiceReferenceBookViewUiBinder ourUiBinder = GWT.create(ServiceReferenceBookViewUiBinder.class);
}